<?php
trait HelloWorld {
    public function sayHello() {
        echo 'Hello World!';
    }
}

class HelloUniverse {
    use HelloWorld;
    public function sayHello() {
        echo 'Hello Universe!';
    }
}

$hello = new HelloUniverse();
$hello -> sayHello();
?>